﻿@*
    author Hws
*@
@{
    ViewData["Title"] = "登录";
    Layout = "";
}
<!DOCTYPE html>
<html lang="en" class="no-js">

<head>

    <meta charset="utf-8">
    <title>lyAdmin</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" type="image/x-icon" href="/images/admin/favicon.ico" />
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- CSS -->
    <link rel="stylesheet" href="/css/site.css">
    <link rel="stylesheet" href="/css/admin/supersized.css">
    <link rel="stylesheet" href="/css/admin/style.css">

    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
        <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <style type="text/css">
        a {
            display: inline-block;
            text-decoration: none;
            height: 20px;
            line-height: 20px;
            color: #939393;
        }

        h1 {
            letter-spacing: 10px;
        }

        form {
            margin: 0px auto 0 auto;
        }
    </style>
</head>

<body>

    <div class="page-container">
        <h1>
            <img alt="" src="/images/admin/logo.png" style="    height: 104px;
    width: 400px;">
        </h1>

        <!-- 超级搭讪管理后台后台登录 -->

        <form onSubmit="return false">
            <input type="text" id="loginId" name="loginId" class="username" placeholder="登陆账号" value="admin" />
            <input type="password" id="password" name="password" class="password" placeholder="密码" value="" />
            <button id="login">登录</button>
            <div class="error"><span>+</span></div>
        </form>
        <div class="connect">
            <p>
            </p>
        </div>
    </div>

    <!-- Javascript -->
    <script src="/javascript/jquery-1.8.2.min.js"></script>
    <script src="/javascript/supersized.3.2.7.min.js"></script>
    <script src="/javascript/supersized-init.js"></script>
    <script src="/javascript/scripts.js"></script>

</body>
<script type="text/javascript">

    var basePath = '@ViewData["basePath"]';

	if (top.vm) {
        top.window.location = '/admin/System/login';
	}

	$('#login').bind('click',function(){
		var loginId = $('#loginId').val();
		var password = $('#password').val();
		if(!loginId || !password){
			alert("请输入用户名和密码!");
        } 
		$.ajax({
            url: basePath + "admin/system/sginIn",
			type: "POST",
			data:{
                login : $('#loginId').val(),
                password : $('#password').val()
			},
            success: function (datas) { 
				if(datas.code == 200){
					window.location.href= basePath + datas.msg;
				}else{
					alert(datas.msg);
				}
			}
		});
	});

	$("body").keydown(function(event) {
		 if (event.keyCode == "13") {   //keyCode=13是回车键
			$("#login").click();
		 }
	});


</script>


</html>


